package cn.cdeden.knowledge.service;

import cn.cdeden.common.core.utils.page.TableDataInfo;
import cn.cdeden.knowledge.domain.SysFormDocTemp;
import cn.cdeden.knowledge.domain.SysFormDocTempDto;
import cn.cdeden.knowledge.domain.SysFormDocTempQueryParam;
import cn.cdeden.knowledge.domain.Template;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.data.domain.Pageable;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Set;

/**
* @author Chen
* @date 2023-12-26
*/
public interface SysFormDocTempService extends IService<SysFormDocTemp> {

    static final String CACHE_KEY = "sysFormDocTemp";

    /**
    * 查询数据分页
    * @param query 条件
    * @param pageable 分页参数
    * @return PageInfo<SysFormDocTempDto>
    */
    TableDataInfo<SysFormDocTempDto> queryAll(SysFormDocTempQueryParam query, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param query 条件参数
    * @return List<SysFormDocTempDto>
    */
    List<SysFormDocTempDto> queryAll(SysFormDocTempQueryParam query);

    SysFormDocTemp getById(Long id);
    SysFormDocTempDto findById(Long id);

    /**
     * 插入一条新数据。
     * @return
     */
    SysFormDocTemp insert(SysFormDocTempDto resources);
    SysFormDocTemp updateById(SysFormDocTempDto resources);
    int removeById(Long id);
    int removeByIds(Set<Long> ids);

    /**
     * 查询流程挂着的表单
     * @param deployId
     * @return
     */
//    SysFormDocTemp selectSysDeployFormByDeployId(String deployId);

//    TableDataInfo<SysFormDocTempDto> TemplateConvertFormDataDto(TableDataInfo<Template> templatesPageInfo);

    @Transactional(rollbackFor = Exception.class)
    SysFormDocTemp copySysFormDocTempById(Long id, Integer formType, Long userId);

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    // void download(List<SysFormDocTempDto> all, HttpServletResponse response) throws IOException;
}
